<?php 
session_start();

if (!isset($_SESSION['usuario'])) {
		//die('No authorization (invalid access)'.$_SESSION['usuario']);

	header('Location: ../login');
	session_destroy();
	exit();
}

if (isset($_GET['content'])) {
	$_SESSION['content'] = $_GET['content'];
}
$target = (isset($_GET['target']) ? $_GET['target'] : '');
include 'include.php';

?>

<!DOCTYPE html>
<html><head><title>Show Me</title>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic' rel='stylesheet' type='text/css'>

	<link rel="stylesheet" type="text/css" href="../css/kube.css" />
	<link rel="stylesheet" type="text/css" href="../css/master.css" />

	<script src="http://code.jquery.com/jquery.min.js"></script>

</head>
<body>
	<div class="units-row">
    		<div class="unit-80">
			<nav class="nav-tabs unit-100">
			<ul><li><a href="../">Show Me</a></li>
			<?php 
				if ($_SESSION['perfil']=='admin') {
					if ($_SESSION['content']=='Admin')
						echo '<span><b>Admin</b></span></li>';
					else
						echo '<li><a href="../index.php?content=Admin">Admin</a></li>';
				}
				
				echo ($_SESSION['content']=='Films')?'<li><span><b>Films</b></span></li>':'<li><a href="../index.php?content=Films">Films</a></li>';
				echo ($_SESSION['content']=='Series')?'<li><span><b>TV Series</b></span></li>':'<li><a href="../index.php?content=Series">TV Series</a></li>';
				echo ($_SESSION['content']=='eBooks')?'<li><span><b>eBooks</b></span></li>':'<li><a href="../index.php?content=eBooks">eBooks</a></li>';
				echo ($_SESSION['content']=='Music')?'<li><span><b>Music</b></span></li>':'<li><a href="../index.php?content=Music">Music</a></li>';
				echo ($_SESSION['content']=='FM')?'<li><span><b>File Manager</b></span></li>':'<li><a href="../index.php?content=FM">File Manager</a></li>';
			?>
			</ul>
			</nav>
		</div>
    		<div class="unit-20">
			<form action="search.php" method="get">
			<input type="text" name="q" class="input-search" placeholder="Search" />
			</form>
		</div>
	</div>

	<div class="message message-success end">
		<?php echo $target;?> 
	</div>


	<div id="main">
		<?php listFolder($_SESSION['content'], $target); ?>
	</div>
	<footer id="footer">
		<nav class="nav-g">
			<ul><li><a href="../login/about.html">About</a></li><li><a href="/wiki/">Wiki</a></li></ul>
		</nav>
		<p>&copy; Bigbank 2014</p>
	</footer>
</body>
</html>
